home *** CD-ROM | disk | FTP | other *** search
/ Assassins - Ultimate CD Games Collection 2 / Assassins 2 - Ultimate Games No. 2 (1995)(Weird Science)[!][Amiga-CD32-CDTV].iso / puzzles / picture_it / source / highscore.amos / highscore.amosSourceCode
AMOS Source Code  |  1995-01-01  |  909b  |  53 lines

  1. Rem
  2. Rem Simple highscore table with saving to disc 
  3. Rem              by Mike Wellman 
  4. Rem
  5. Dim T$(10),PNT$(10)
  6. '
  7. Open Random 1,"HIGHSCORE"
  8. Field 1,10 As HIGHNAME$,7 As SCR$
  9. '
  10. Rem run this next part to set up initial file once only. 
  11. 'For i=1 to 10 
  12. 'HIGHNAME$="Mike"
  13. 'SCR$=str$(2000+i*20)
  14. 'Put 1,i 
  15. 'Next
  16. '
  17. Input "? ";SCORE : Rem score from game
  18. '
  19. For I=1 To 10
  20.  Get 1,I
  21.  T$(I-1)=HIGHNAME$ : PNT$(I-1)=SCR$
  22. Next 
  23. '
  24. TEMP$=Str$(SCORE)
  25. For A=1 To 10
  26.    V1=Val(TEMP$) : V2=Val(PNT$(A-1))
  27.    If V1>V2
  28.      PNT$(10)=TEMP$
  29.       Input "> ";T$(10) : Rem players name in here 
  30.     Put 1,9
  31.    Exit 
  32.   End If 
  33. Next 
  34. '
  35. For A=0 To 9
  36.    For B=A+1 To 10
  37.      If Val(PNT$(B))>Val(PNT$(A))
  38.         Swap T$(A),T$(B) : Swap PNT$(A),PNT$(B)
  39.      End If 
  40.    Next 
  41. Next 
  42. '
  43. For I=1 To 10
  44.    HIGHNAME$=T$(I-1)
  45.    SCR$=PNT$(I-1)
  46.    Put 1,I
  47. Next 
  48. Wait 100
  49. Cls 0
  50. For I=1 To 10
  51.   Get 1,I
  52.   Text 40,15*I,HIGHNAME$ : Text 140,15*I,SCR$
  53. Next